//
//  GetData.h
//  OpperV1.0
//
//  Created by Le Dung on 5/10/13.
//  Copyright (c) 2013 LeDung. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ControlImport.h"
#import "AppDelegate.h"
@interface GetData : NSObject

+(AppDelegate*)App;


// main function
+(void )login:(NSString*)jsonString;
+(void)getListProfile;
+(BOOL)addMember:(Member*)member;
+(NSMutableArray *)getContractList:(NSString*)memberId;


//data function
+(void)getListData;
+(NSMutableArray *)getCategorys:(NSArray*)array;
+(NSMutableArray *)getProvider:(NSArray*)array;
+(NSMutableArray *)getProduct:(NSArray*)array;
+(NSMutableArray *)productFilter :(NSMutableArray *)destinationArray andCategoryId:(NSString*)categoryId andProviderId :(NSString *)providerId;


//convert
+(NSUserDefaults *)UserDefault ;
+(NSData * )dictionaryToData :(NSMutableDictionary*)dictionary;
+(NSMutableDictionary *)dataToDictionary:(NSData*)data;
+(NSString*) sendRequest :(NSString *)functionName andDictionary :(NSMutableDictionary  *)dictionary;
+(NSArray *)fetchJson:(NSString *)resString andKey:(NSString *)keyWord;
+(NSDictionary *)fetchJson:(NSString *)resString;

+(BOOL)checkError:(NSString*)jsonString;
+(NSString *)checkMassage:(NSString*)jsonString;

@end
